package com.ruoyi.printer.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.printer.domain.PrinterOrder;
import com.ruoyi.printer.domain.vo.PrinterVo;
import com.ruoyi.printer.mapper.PrinterOrderMapper;
import com.ruoyi.printer.service.IPrinterOrderService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单Service业务层处理
 * @author yanyi
 * @date 2023-07-13
 */
@Service
public class PrinterOrderServiceImpl extends ServiceImpl<PrinterOrderMapper, PrinterOrder> implements IPrinterOrderService {
    /**
     * 查询订单
     * @param orderId 订单主键
     * @return 订单
     */
    @Override
    public PrinterOrder selectPrinterOrderByOrderId(String orderId) {
        return baseMapper.selectPrinterOrderByOrderId(orderId);
    }

    /**
     * 查询订单列表
     * @param printerOrder 订单
     * @return 订单
     */
    @Override
    public List<PrinterOrder> selectPrinterOrderList(PrinterOrder printerOrder) {
        return baseMapper.selectPrinterOrderList(printerOrder);
    }

    /**
     * 新增订单
     * @param printerOrder 订单
     * @return 结果
     */
    @Override
    public int insertPrinterOrder(PrinterOrder printerOrder) {
        return baseMapper.insert(printerOrder);
    }

    /**
     * 修改订单
     * @param printerOrder 订单
     * @return 结果
     */
    @Override
    public int updatePrinterOrder(PrinterOrder printerOrder) {
        return baseMapper.updateById(printerOrder);
    }

    /**
     * 批量删除订单
     * @param orderIds 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deletePrinterOrderByOrderIds(String[] orderIds) {
        return baseMapper.deletePrinterOrderByOrderIds(orderIds);
    }

    /**
     * 删除订单信息
     * @param orderId 订单主键
     * @return 结果
     */
    @Override
    public int deletePrinterOrderByOrderId(String orderId) {
        return baseMapper.deletePrinterOrderByOrderId(orderId);
    }

    /**
     * 根据订单id查询打印信息
     * @param orderId 订单id
     * @return 结果
     */
    @Override
    public PrinterVo selectByOrderId(String orderId){
        return baseMapper.selectByOrderId(orderId);
    }
}
